<?php

class ScheduleEventBasket extends ScheduleEvent
{

	protected $_round;
	protected $_homeTeam;
	protected $_awayTeam;
	protected $_homeScore;
	protected $_awayScore;
	protected $_winningTeam;
	protected $_pointsDifference;
	protected $_pointsTotal;
	protected $_overtime;
	
	public function round() { return $this->_round; }
	public function homeTeam() { return $this->_homeTeam; }
	public function awayTeam() { return $this->_awayTeam; }
	public function homeScore() { return $this->_homeScore; }
	public function awayScore() { return $this->_awayScore; }
	public function winningTeam() { return $this->_winningTeam; }
	public function pointsDifference() { return $this->_pointsDifference; }
	public function pointsTotal() { return $this->_pointsTotal; }
	public function overtime() { return $this->_overtime; }
	
	public function setRound($round)
	{
		if(is_string($round))
		{
			$this->_round = $round;
		}
	}
	public function setHomeTeam($homeTeam)
	{
		if(is_string($homeTeam))
		{
			$this->_homeTeam = $homeTeam;
		}
	}
	public function setAwayTeam($awayTeam)
	{
		if(is_string($awayTeam))
		{
			$this->_awayTeam = $awayTeam;
		}
	}
	public function setHomeScore($homeScore)
	{
		$homeScore = (int) $homeScore;
		if(is_int($homeScore))
		{
			$this->_homeScore = $homeScore;
		}
	}
	public function setAwayScore($awayScore)
	{
		$awayScore = (int) $awayScore;
		if(is_int($awayScore))
		{
			$this->_awayScore = $awayScore;
		}
	}
	public function setWinningTeam()
	{
		if($this->_homeScore > $this->_awayScore) $this->_winningTeam = 1;
		else $this->_winningTeam = 2;
	}
	public function setPointsDifference()
	{
		$this->_pointsDifference = abs($this->_homeScore - $this->_awayScore);
	}
	public function setPointsTotal()
	{
		$this->_pointsTotal = $this->_homeScore + $this->_awayScore;
	}
	public function setOvertime($overtime)
	{
		if(is_int($overtime))
		{
			$this->_overtime = $overtime;
		}
	}
	
	public function setResult($hScore, $aScore, $overtime)
	{
		$this->setHomeScore($hScore);
		$this->setAwayScore($aScore);
		$this->setOvertime($overtime);
		$this->setWinningTeam();
		$this->setPointsDifference();
		$this->setPointsTotal();
	}
}

?>